#ifndef __I_ACTION_H__
#define __I_ACTION_H__

#include <zlib/lib/I_Ptr.h>
#include "I_Lock.h"
#include "Continuation.h"


class Action
{
public:
	Continuation *continuation;
	Ptr<ProxyMutex> mutex;

	volatile int cancelled;

	void cancle_action()
	{
		if(!cancelled)
			cancelled = true;
	}

	virtual void cancle()
	{
		cancle_action();
	}

	Continuation *operator=(Continuation *acont)
	{
		continuation = acont;
		if(acont)
			mutex = acont->mutex;
		else
			mutex = 0;

		return acont;
	}


	Action() : continuation(NULL), cancelled(false) {}
};


#endif //__I_ACTION_H__
